<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .wrap{
            display: flex;
        }
        .nav{
            width: 50%;
            border: 1px solid #ccc;
            text-align: center;
            font-size: 30px;
        }
        .router-link-active{
            background-color: pink;
        }
        .conet{
            text-align: center;
        }
        .v-enter,.v-leave-to{
            opacity: 0;
        }
        .v-enter-active,.v-leave-active{
            transition: all 2s;
        }
        .v-move{
            transition: all 2s;
        }
        .v-leave-active{
            position: absolute;
        }
        .qq{
            width: 400px;
        }
    </style>
</head>
<body>
    <div id="app">
    <div class="wrap">
        <router-link to="/qk" class="nav" tag="div">个人基本情况</router-link>
        <router-link to="/girl" class="nav" tag="div">推荐心动女生</router-link>
    </div>
    <router-view class="conet"></router-view>
</div>
<template id="qk">
    <div>
        <h1>个人情况</h1>
        <p> 我叫张世舰，性别男，爱好女</p>
    </div>
</template>
<template id="girl">
    <div>
        <h2>谁能百里挑一，唯我电商张世舰</h2>
        <div>
        <router-link to="/one">心动女生一号</router-link>
        <router-link to="/two">心动女生二号</router-link>
    </div>
    <transition>
        <router-view class="qq"></router-view>
    </transition>
   
    </div>
</template>
       
</body>
<script src="./vue.js"></script>
<script src="./vue-router.js"></script>
<script>
     let qk ={
        template:"#qk"
    }
    let girl ={
        template:"#girl"
    }
    let one ={
        template:"<img src='./dile.jpg'>"
    }
    let two ={
        template:"<img src='./ruhua.jpg'>"
    }
    const routerObj = new VueRouter({
        routes: [
            {path: "/qk", name: "qk", component: qk},
            {path: "/girl", name: "girl", component:girl, children:[
                {path:"/one" ,component:one},
                {path:"/two" ,component:two},
            ]},
        ],
    })
    let vm = new Vue({
        el: "#app",
        router: routerObj
    })
</script>
</html>